home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 11 / AMUG BBS in a Box Volume XI (April 1994) (MacWizards).iso / Files / Hyper / M-Md / MacApp™ Info.sit / MacApp™ info / MacApp™ info / card_8796.txt < prev    next >
Encoding:
Text File  |  1988-01-30  |  1.9 KB  |  85 lines

  1. -- card: 8796 from stack: in
  2. -- bmap block id: 10234
  3. -- flags: 0000
  4. -- background id: 5359
  5. -- name: Object Oriented 5
  6. ----- HyperTalk script -----
  7. on startup
  8.   hide card field "example"
  9. end startup
  10.  
  11. on closecard
  12.   hide card field "example"
  13. end closecard
  14.  
  15. on arrowKey direction
  16.   if direction = "left" then
  17.     visual scroll right
  18.     go to prev card
  19.   else if direction = "right" then
  20.     visual scroll left
  21.     go to next card
  22.   else if direction = "up" then
  23.     visual dissolve slow
  24.     go to card "Main Menu 1"
  25.   end if
  26. end arrowKey
  27.  
  28.  
  29.  
  30.  
  31. -- part 3 (button)
  32. -- low flags: 00
  33. -- high flags: 8000
  34. -- rect: left=386 top=85 right=144 bottom=460
  35. -- title width / last selected line: 0
  36. -- icon id / first selected line: 27056 / 27056
  37. -- text alignment: 1
  38. -- font id: 0
  39. -- text size: 12
  40. -- style flags: 0
  41. -- line height: 16
  42. -- part name: Example
  43. ----- HyperTalk script -----
  44. on mouseUp
  45.   show card field "example"
  46. end mouseUp
  47.  
  48.  
  49.  
  50. -- part 2 (field)
  51. -- low flags: 81
  52. -- high flags: 2004
  53. -- rect: left=238 top=35 right=144 bottom=502
  54. -- title width / last selected line: 0
  55. -- icon id / first selected line: 0 / 0
  56. -- text alignment: 0
  57. -- font id: 3
  58. -- text size: 12
  59. -- style flags: 0
  60. -- line height: 16
  61. -- part name: Example
  62. ----- HyperTalk script -----
  63. on mouseup
  64.   hide card field "example"
  65. end mouseup
  66.  
  67.  
  68.  
  69. -- part contents for background part 6
  70. ----- text -----
  71.  
  72.  
  73. Object methods are where most of the work of an object-oriented program is done.  They may include both functions (which return a value) and procedures (which do not).  Typically, methods in object-oriented programs are very small, almost never exceeding a page in length, and perform only a single task, thereby increasing modularity.
  74. In short, an object's methods define its behavior.
  75.  
  76. -- part contents for background part 5
  77. ----- text -----
  78. Object Methods
  79.  
  80. -- part contents for card part 2
  81. ----- text -----
  82. In the chess example, typical methods might include:
  83.      Pawn.Move(#-of-spaces)
  84.      Pawn.WhereAreYou(returns loc)
  85.      Pawn.Draw